<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ContactGroupList.ascx.cs" Inherits="admin_webparts_Plug_ins_Contact_ContactGroupList" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<%@ Import Namespace="NTTHAO.Web.BL.Contact" %>
<div class="tip">
    <h1 style="left: 0px; position: relative;"><%=LanguageUtility.GetLanguageText("CONTACT_MANAGEMENT", Session)%></h1>
    <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
</div>
<%if(Context.User.Identity.Name.Equals("admin", StringComparison.OrdinalIgnoreCase)) { %>
<p>
    <span id="addCat" class="yui-button yui-link-button yuibtn yuibtn-icon btnaddl"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=addgroup" tabindex="0"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
</p>
<script type="text/javascript">
    YAHOO.util.Event.onContentReady('addCat', function () {
        var oAddCat = new YAHOO.widget.Button("addCat");
    });
</script>
<%} %>
<table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid" style="margin-top: 10px;">
    <tr>
        <th width="20px">#</th>
        <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
        <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
<%if(Context.User.Identity.Name.Equals("admin", StringComparison.OrdinalIgnoreCase)) { %>
        <th width="42px">&nbsp;</th>
<%} %>
    </tr>
<%
if (this._List != null)
{
    for (int i = 0; i < this._List.Rows.Count; i++)
    {
        System.Data.DataRow row = this._List.Rows[i];
        string id = row[ContactGroup.ID__COLUMN_NAME].ToString();
        string name = row[ContactGroup.NAME__COLUMN_NAME].ToString();
        bool actived = (bool)row[ContactGroup.ACTIVED__COLUMN_NAME];
%>
    <tr class="<%=(i%2==1?"even":"odd") %>">
        <td align="center"><%=i + 1 %></td>
        <td><b><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=viewgroup&id=<%=id %>"><%=name %></a></b></td>
        <td align="center"><%=(actived ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
<%if(Context.User.Identity.Name.Equals("admin", StringComparison.OrdinalIgnoreCase)) { %>
        <td align="center">
            <ul class="icon" style="width: 84px;">
                <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=editgroup&id=<%=id %>" class="icon editbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("CONFIG", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=configgroup&id=<%=id %>" class="icon configbtn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("DELETE", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=deletegroup&id=<%=id %>" class="icon deletebn" onclick="javascript: return confirm('<%=LanguageUtility.GetLanguageText("CONFIRM_DELETE", Session).Replace("<br />", "\\n")%>');">&nbsp</a></li>
            </ul>
        </td>
<%} %>
    </tr>
<%
    }
} %>
</table>
